package com.ljh.gmall.user.service.impl;


import com.ljh.gmall.bean.UmsMember;
import com.ljh.gmall.bean.UmsMemberReceiveAddress;
import com.ljh.gmall.service.UserService;
import com.ljh.gmall.user.mapper.UmsMemberReceiveAddressMapper;
import com.ljh.gmall.user.mapper.UserMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;


import java.util.List;


@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Autowired
    UmsMemberReceiveAddressMapper umsMemberReceiveAddressMapper;


    @Override
    public List<UmsMember> getAllUser() {
        List<UmsMember> umsMembers=userMapper.selectAll();
        return umsMembers;
    }

    @Override
    public List<UmsMemberReceiveAddress> getUmsMemberAddressById(String memberId) {
        Example example=new Example(UmsMemberReceiveAddress.class);
        example.createCriteria().andEqualTo("memberId",memberId);
        return umsMemberReceiveAddressMapper.selectByExample(example);
    }
}
